<extend name="layout/index"/>
<block name="content">
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-sm-4">
		<h2>修改密码</h2>
		<ol class="breadcrumb">
			<li><a href="{:url('Index/index')}">主页</a></li>
			<li><strong>修改密码</strong></li>
		</ol>
	</div>
</div>

<div class="row">
	<div class="col-lg-12">
		<div class="wrapper wrapper-content animated fadeInUp">

			<div class="mail-box">


				<div class="mail-body">
					<form id="editForm" name="editForm" enctype="multipart/form-data"
						class="form-horizontal" role="form">
						<div class="row">
							<div class="col-md-6">
							
								<div class="form-group">
									<label class="col-sm-3 control-label">旧密码<font
										style="color: red">*</font>：
									</label>
									<div class="col-sm-9">
										<input type="password" id="oldPwd" name="oldPwd"
											value="" class="form-control"
											placeholder="请输入旧密码" >

									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">新密码<font
										style="color: red">*</font>：
									</label>
									<div class="col-sm-9">
										<input type="password" id="newPwd" name="newPwd"
											value="" class="form-control"
											placeholder="请输入6-20位字母或者数字新密码" > 

									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label">确认密码<font
										style="color: red">*</font>：
									</label>
									<div class="col-sm-9">
										<input type="password" id="newPwd1" name="newPwd1"
											value="" class="form-control"
											placeholder="请再输入一次新密码" >
									</div>
								</div>
								<div class="form-group">
									<div class="text-center">
											<button type="button" id="btns" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i> 确认修改</a></button>
										<button type="reset" class="btn btn-warning btn-sm"> <i class="fa fa-times"></i> 重置</button>								
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>

		</div>
	</div>

</div>

</block>
<block name="js">
	<script>
		$("#btns").click(function(){
			//   alert($("form").serialize());
			$.ajax({
				type : "post",
				url : "{:url('index/password')}",
				data : $("form").serialize(),
				dataType : "json",
				success : function(data) {
					layer.msg(data.msg);
					if (data.code==1) {
						setTimeout(function(){
							location.href=data.url;
						}, 3000);
					}
				},
				error : function(err) {
					layer.alert(err.info, 8);
				}
			});
		})
	</script>
	</block>